<script>
	$(document).ready(function(){
		$("nav ul li.category a").css({"color":"blue"});
		$(".it-nav .product a").css({'color':'blue'});
	});
	function show_hidden(id,status){
		var href = window.location.href;
		$.get("back/product/show_hidden/"+id+"/"+status).success(function(){
			$(".ITwrapper").load(href+' .ITwrapper');
		});
	}
</script>
<section class="content-header">
	<h1>Danh sách sản phẩm</h1>
	<nav>
		<ul>
			<li class="product"><a href="back/product">Tất cả sản phẩm</a></li>
			<li class="category"><a href="back/product/category">Danh mục sản phẩm</a></li>
		</ul>
	</nav>
</section><!--content-header-->
<form method="post" action="back/product/delete_many">
	<section class="content-view">
		<span class = "title">Danh sách danh mục</span>
		<section class="advance">
					<section class="tool">
						<ul>
							<li><button><a href="back/product/create_cate">Thêm mới</a></button></li>
							<li><input type ="submit" value="Hiển thị" id="show"></li>
						</ul>
					</section><!--End tool-->
		</section><!--End advance-->
		<section class="table">
			<table>
				<tr>
					<th width=30px>STT</th>
					<th>Tên danh mục</th>
					<th width= 100px>Danh mục cha</th>
					<th width= 100px>Trạng thái</th>
					<th width= 100px>Thao tác</td>
				</tr>
				<tbody>
				<?php foreach($category as $category_info){?>
					<tr>
						<td><?php echo $category_info['cate_id'];?></td>
						<td><?php echo $category_info['cate_name'];?></td>
						<td><?php echo $category_info['main_menu'];?></td>
						<td  align="center"><img src="<?php echo $category_info['status']==1?'/public/back/img/check.ico':'/public/back/img/hidden.ico';?>" title="" onclick="show_hidden(<?php echo $category_info['cate_id']?>,<?php echo $category_info['status'];?>)"/></td>
						<td  align="center"><a href="back/admin/edit" title="Edit"><img src="/public/back/img/edit.ico"/></a>&nbsp;&nbsp;&nbsp;<img src="/public/back/img/delete.ico" onclick="delete_news()" title="Delete"/></td>
					</tr>
					<?php }?>
				</tbody>
			</table>
		</section><!--End table-->	
	</section><!--End content-view-->
</form>